<template>
  <div>
    <to-search></to-search>
    <v-card :arr="arr"></v-card>
  </div>
</template>

<script>
import { reqlist } from "../../http/http";
export default {
  data() {
    return {
      // 1.初始值
      arr: [],
    };
  },
  mounted() {
    //2.请求数据
    reqlist({
      cateid: this.$route.query.id,
      // 根据有无type来决定是一级分类还是二级分类，1级无，二级有
      type: this.$route.query.type?2:1,
    }).then((res) => {
      // console.log(res);
      this.arr = res.data.list.goodData ? res.data.list.goodData : [];
    });
  },
};
</script>

<style>
</style>